// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 4/12/2007 09:14:48
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   RMenuItem.java

package utility;

import java.awt.*;
import java.util.Locale;

// Referenced classes of package de.escape.quincunx.i18n:
//            I18n, Localizable

public class RMenuItem extends MenuItem
    implements Localizable
{

    public RMenuItem(String tag)
    {
        setTag(tag);
    }

    public RMenuItem(String tag, Locale l)
    {
        setTag(tag, l);
    }

    public RMenuItem(String tag, MenuShortcut sc)
    {
        setTag(tag);
        setShortcut(sc);
    }

    public RMenuItem(String tag, MenuShortcut sc, Locale l)
    {
        setTag(tag, l);
        setShortcut(sc);
    }

    public void setTag(String tag)
    {
        resTag = tag;
        setLabel(I18n.getString(resTag, getLocale()));
    }

    public void setTag(String tag, Locale l)
    {
        resTag = tag;
        locale = l;
        setLabel(I18n.getString(resTag, l));
    }

    public void setLocale(Locale l)
    {
        locale = l;
        setLabel(I18n.getString(resTag, l));
    }

    public Locale getLocale()
    {
        if(locale == null && getParent() != null)
        {
            java.awt.MenuContainer m = getParent();
            if(m instanceof Localizable)
                return ((Localizable)m).getLocale();
        }
        return locale;
    }

    protected Locale locale;
    protected String resTag;
}